import 'package:flutter/material.dart';
import 'package:demoapp/News/NewsPage.dart';
import 'package:demoapp/main/MainPage.dart';


void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  Widget widget = Center(
    child: Text(
      '第一个fl程序！hello',
      style: TextStyle(
          color: Colors.red,
          fontSize: 25,
          fontStyle: FontStyle.normal,
          decoration: TextDecoration.none),
    ),
  );
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flitter Demo',
      theme: ThemeData(
        primaryColor: Colors.red,
        accentColor: Colors.amberAccent,
        primarySwatch: Colors.blue,
      ),
      home: MainPage(),
      routes: {
        //设置路由
        '/main': (BuildContext context) => MainPage(),
        '/news': (BuildContext context) => NewsPage()
      },
    );
  }
}
